package com.proxy;

import java.lang.reflect.Proxy;

/**
 * @ClassName Test
 * @Description
 * @Author xinggh
 * @Date 2020/8/16 18:49
 * @Version 1.0
 **/
public class Test {
    public static void main(String[] args) {
        DemoService demoService = new DemoServiceImpl();
        DemoService o = (DemoService) Proxy.newProxyInstance(demoService.getClass().getClassLoader(),
                demoService.getClass().getInterfaces()
                , new DemoServiceIHandler(demoService));
        System.out.println(o.say("x"));
    }
}
